<template>

  <div>
    <h1>用户注册</h1>
    <span>用户名&nbsp:<el-input style="width: 400px" v-model="list.username" placeholder="请输入用户名"></el-input></span><br><br>
    <span>密&nbsp&nbsp码&nbsp;:<el-input style="width: 400px" v-model="list.password" placeholder="请输入密码"></el-input></span><br><br>
    <span>手机号&nbsp:<el-input style="width: 400px" v-model="list.phone" placeholder="请输入手机号"></el-input></span><br><br>
    <span>邮&nbsp箱&nbsp:<el-input style="width: 400px" v-model="list.mail" placeholder="请输入邮箱"></el-input></span><br><br>
    <span>身份证号：<el-input style="width: 400px" v-model="list.idnumber" placeholder="请输入身份证号"></el-input></span><br><br>
    <el-button type="primary"@click="add()">点击注册</el-button>
    <router-link to="/" tag="a"> <span>退出</span></router-link>
  </div>
</template>

<script>
import {data} from 'autoprefixer'

export default {
  name: 'register',
  data() {
    return {
      input: '',
      list:{
        username:"",password:"",phone:"",mail:"",idnumber:""
      }
    }

  },
  methods:{
    add(){
     this.$http.post("/fuser/insert",this.list).then(data=>{
       console.log(data)
       if (data==true){
         alert("添加成功")
         this.$router.push("/")
       }else {
         alert("添加失败")
       }
     })
    }
  }
}
</script>

<style scoped>

</style>
